# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
#
# This PKGBUILD was extracted from AUR.
# Creator: Anton Leontiev <scileont /at/ gmail.com>
# Changes by: petruknisme

pkgname=perl-test-identity
_pkgname=Test-Identity
pkgver=0.01
pkgrel=6
pkgdesc='Perl module to test the referential identity of a reference.'
arch=('any')
url='https://metacpan.org/release/Test-Identity'
license=('GPL' 'PerlArtistic')
depends=('perl' 'perl-module-build')
options=('!emptydirs')
source=("http://search.cpan.org/CPAN/authors/id/P/PE/PEVANS/$_pkgname-$pkgver.tar.gz")
sha512sums=('eee20978e2e39a11c5649b4609840f02686482f8fe4c0c2de639bfd9749ba9a08202f70b660432f1142ff800824ee2a6e9e43873f3f089041cd3e864ff502c32')

build() {
  cd "$_pkgname-$pkgver"

  ( export PERL_MM_USE_DEFAULT=1 PERL5LIB="" PERL_AUTOINSTALL=--skipdeps \
    PERL_MM_OPT="INSTALLDIRS=vendor DESTDIR='$pkgdir'" \
    PERL_MB_OPT="--installdirs vendor --destdir '$pkgdir'" \
    MODULEBUILDRC=/dev/null

    /usr/bin/perl Build.PL INSTALLDIRS=vendor && ./Build
  )
}

package() {
  cd "$_pkgname-$pkgver"

  ./Build install

  find "$pkgdir" -name .packlist -o -name perllocal.pod -delete
}

